package com.sskj.award.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.award.bean.DividendRecordBean;
import com.sskj.award.ui.activity.DividendRecordActivity;
import com.sskj.common.base.HttpData;
import com.sskj.lib.http.JsonCallBack;

import java.util.List;

public class DividendRecordPrestener extends BasePresenter<DividendRecordActivity>{
    public void getRecordData(String type,String page) {
        httpService.getRecordData(type,page)
                .tag(this)
                .execute(new JsonCallBack<HttpData<DividendRecordBean>>(this) {
                    @Override
                    public void onSuccess(Response<HttpData<DividendRecordBean>> response) {

                        DividendRecordBean data = response.body().getData();
                        mView.getRecordDataSuccess(data);
                    }
                    @Override
                    public void onFinish() {
                        super.onFinish();
                        mView.onStopSuccess();
                    }
                });
    }

    public void getMoneyRecordData(String type,String page) {
        httpService.getMoryRecordData(type,page)
                .tag(this)
                .execute(new JsonCallBack<HttpData<DividendRecordBean>>(this) {
                    @Override
                    public void onSuccess(Response<HttpData<DividendRecordBean>> response) {
                        DividendRecordBean data = response.body().getData();
                        mView.getMoneyRecordDataSuccess(data);
                    }

                    @Override
                    public void onFinish() {
                        super.onFinish();
                        mView.onStopSuccess();
                    }
                });
    }
}
